#!/bin/bash

# ebbms setup script #
# (C) 2011 Yuuki Taguchi #

# abort process
abort() {
	[ -n "$1" ] && echo "$1"
	echo -e 'Abort!\a'
	exit 1
}


# import repository
cat << EOF > /etc/apt/sources.list.d/webmin.list
# webmin repository
deb http://download.webmin.com/download/repository sarge contrib
deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib 
EOF

wget http://www.webmin.com/jcameron-key.asc -P /tmp
apt-key add /tmp/jcameron-key.asc
rm -f /tmp/jcameron-key.asc


# update repository #
#apt-add-repository ppa:chris-lea/python-tweepy





# package install #
apt-get update
cat << EOF | sed -e '/^#/d' -e '/^$/d' | xargs apt-get -y install || abort "Error Install Package."
#--------------------------------------------------#

# driver
#firmware-atheros
#firmware-bnx2x
#firmware-b43-installer
#firmware-b43-lpphy-installer
#firmware-b43legacy-installer
#firmware-brcm80211
#firmware-bnx2
#firmware-intelwimax
#firmware-ipw2x00
#firmware-ivtv
#firmware-iwlwifi
#firmware-linux
#firmware-linux-free
#firmware-linux-nonfree        
#firmware-netxen
#firmware-qlogic
firmware-ralink
#firmware-realtek

# basic package
subversion
vim
tree

# perl module
libnet-oauth-perl
libconfig-simple-perl
libnet-twitter-lite-perl

# python module
python-argparse
python-daemon
python-feedparser
python-ftdi
python-mysqldb
python-psyco

# manage
webmin

# web server
php5
php5-mysql
apache2

# mail server


# database server
mysql-server

<<<<<<< .mine

# source code management system
subversion


=======
>>>>>>> .r71
#--------------------------------------------------#
EOF


# package remove #
cat << EOF | sed -e '/^#/d' -e '/^$/d' | xargs apt-get -y --purge remove || abort "Error Remove Package."
#--------------------------------------------------#

# basic package
vim-tiny

#--------------------------------------------------#
EOF


apt-get autoremove
apt-get clean



